/**
 * @author Guy Sagy
 */

package webSiteDataStore;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class ConnectionJDBC
{
    private static Connection connection = null;

    static public void createConnection() throws SQLException
    {
        String url = "jdbc:mysql://localhost:3306/WebSiteDataStore?autoReconnect=true";
        String userName = "root";
        String password = "root"; 
        connection = DriverManager.getConnection (url, userName, password);
    }

    static public void destroyConnection() throws SQLException
    {
        SafeFreeResource.closeConnection(connection);
    }

    static public Connection getConnection() throws SQLException
    {
        return connection;
    }
}